A Universal Infrared Remote (UIR) is a remote control device that sends out operational signals to control one or more types of electronic consumer devices such as TVs, VCRs, Cable set-top boxes, and CD/DVD players. Each operational signal conveys a keycode associated with the selected electronic consumer device. Each keycode corresponds to a function of the selected electronic consumer device, such as power on, power off, volume up, volume down, play, stop, select, channel up, channel down, etc. A particular brand and make of electronic consumer device responds to operational signals containing a particular set of keycodes and performs the corresponding functions.
In order to provide the functionality of a UIR, various types of keycodes are stored in keycode tables (also referred to as keycode data structures) in a codeset database format. Each type of keycode table is identified by a three digit device code corresponding to a particular brand and make of an electronic consumer device. A user first programs the UIR to control a particular device type by entering its corresponding three digit device code. Thereafter, when the user presses a key on the UIR, a processor inside the UIR uses the device code to locate the address of a corresponding keycode table. The processor then searches for the keycode of the pressed key within the keycode table. If the keycode is found, then an operational signal is generated and transmitted to control the selected electronic consumer device.
One particular keycode table is defined by a keycode data structure that includes a device type byte, a set of keycodes, system code information, a system data byte, a keycode data structure pointer (KDSP) and a protocol data structure pointer (PDSP) that points to a protocol table which stores timing, modulation, and encoding information. The keycode data structure also includes a number of flagbytes that are used to mask each particular key among the keycodes.
FIG. 1 (prior art) illustrates one method of linking keycode data structures in order to store the codeset database efficiently. In the example of FIG. 1, keycode data structure 1 is used for TV device type 001 and keycode data structure 2 is used for TV device type 002. Keycode data structure 1 contains KEYCODES #1-#5, representing all common keys for a TV. Keycode data structure 2 contains KEYCODE #6, representing the “sleep” key. Suppose that the UIR is programmed to control TV002 and that a user presses the “sleep” key. The processor first locates the byte0 address of keycode data structure 2, it then finds KEYCODE #6 and generates an operational signal using the protocol information of protocol data structure 3 pointed by PDSP 4. Now suppose that the user presses the “power” key. The processor searches but cannot find the keycode of the “power” key in keycode data structure 2. The processor then locates the byte0 address of keycode data structure 1 pointed by KDSP 5. The processor finds the keycode (for instance, KEYCODE #2) corresponding to the “power” key and generates an operational signal using the protocol information of protocol data structure 3 pointed by PDSP 6.
By linking keycode data structures 1 and 2 using KDSP 5, this chain linking method is able to eliminate the redundant storing of keycodes #1-#5 in keycode data structure 2, thereby saving memory space. However, in this example, TV_CODE002 contains all the keycodes of TV_CODE001, in other words, is a superset of TV_CODE001. If TV_CODE001 has an additional keycode that is not included in TV_CODE002, then the chain linking scheme does not work.
FIG. 2 illustrates an example of a codeset database that supports a type of electronic consumer device called a “combo device”. In the example of FIG. 2, TV keycode tables 7 are linked together and VCR keycode tables 8 are linked together using the chain linking scheme. For illustration purposes, assume that the combo device is a television with a built-in VCR. Further assume that the TV portion of the combo device uses TV keycode table TV_CODE003, whereas the VCR portion uses VCR keycode table VCR_CODE103. Under the chain linking scheme, TV_CODE003 and VCR_CODE103 cannot be further linked together because such linking would destroy the database's ability to individually support the TV and the VCR. Therefore, for combo device, TV keycode tables 9 are duplicated from TV keycode tables 7 and then linked to VCR keycode tables 8 by KDSP 10. If an operational signal for a combo device is to be generated, the processor searches for the keycode of the pressed key starting in keycode table TV_CODE203. Searching then proceeds through keycode tables TV_CODE202, TV_CODE201, VCR_CODE103, VCR_CODE102, and VCR_CODE101 until the keycode is found.
Because of the large number of different electronic consumer devices, the amount of memory space needed to store the codeset database is large. Therefore, it is desirable to have an optimized compression scheme of storing a codeset database that reduces the amount of memory substantially. It is especially desirable to be able to store a codeset database for combo devices without the need to duplicate large numbers of keycode tables.